package com.cocolover2.andbase.utils.media_util;

import android.content.Context;
import android.media.MediaScannerConnection;
import android.net.Uri;
import android.util.Log;

@Deprecated
public class MediaUtil {
    /**
     * 拍照后更新媒体库
     *
     * @param context
     * @param filename //filename是我们的文件全路径，包括后缀哦
     */
    public static void updateTakePhoto(Context context, String filename) {
        MediaScannerConnection.scanFile(context,
                new String[]{filename}, null,
                new MediaScannerConnection.OnScanCompletedListener() {
                    public void onScanCompleted(String path, Uri uri) {
                        Log.i("ExternalStorage", "Scanned " + path + ":");
                        Log.i("ExternalStorage", "-> uri=" + uri);
                    }
                });
    }

}
